_month=['01','02','03','04','05','06','07','08','09','10','11','12']

def getNextDate(date):
    firstYear=int(date[0:4])
    firstMonth=date[4:6]
    index=_month.index(firstMonth)
    if index==11:
        nextIndex=0
        nextYear=firstYear+1
    else:
        nextIndex=index+1
        nextYear=firstYear
    return str(nextYear)+_month[nextIndex]



def get12Month(date):
    nowYear = int(date[0:4])
    nowMonth = date[4:6]
    index = _month.index(nowMonth)
    i = 0
    array = []
    year = nowYear
    month = nowMonth
    while i < 12:
        firstDate=str(year)+_month[index]
        array.append([firstDate,getNextDate(firstDate)])
        if index==0:
            index=11
            year=year-1
        else:
            index=index-1
        i=i+1
    array.reverse()
    return array